#pip install --upgrade tencentcloud-sdk-python
import json
from tencentcloud.common import credential
from tencentcloud.common.profile.client_profile import ClientProfile
from tencentcloud.common.profile.http_profile import HttpProfile
from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException
from tencentcloud.cdn.v20180606 import cdn_client, models
class tencentsdk:
    def __init__(self,SecretId,SecretKey):
        self.cred = credential.Credential(SecretId, SecretKey)
    def PurgeUrlsCache(self,down_url):
        httpProfile = HttpProfile()
        httpProfile.endpoint = "cdn.tencentcloudapi.com"
        clientProfile = ClientProfile()
        clientProfile.httpProfile = httpProfile
        client = cdn_client.CdnClient(self.cred, "", clientProfile)
        req = models.PurgeUrlsCacheRequest()
        params = {
            "Urls": [ down_url]
        }
        req.from_json_string(json.dumps(params))
        resp = client.PurgeUrlsCache(req)
        print(resp.to_json_string())